package org.ncibi.cytoscape.metscape.multidisplay;

public enum ValueType {
	UNKNOWN // first: ordinal value is zero!
	, BASIC
	, RATIO
	, LOG_RATIO
	, FOLD_CHANGE
	, LOG_FOLD_CHANGE
	, P_VALUE
	, LOG_P_VALUE
	, FALSE_DISCORVERY_RATE
	, LOG_FALSE_DISCOVERY_RATE
	, INTENSITY
	, LOG_INTENSITY
	;
	
	private static final String[] labels = {"Unknown"
		, "Basic"
		, "Ratio"
		, "Log Ratio"
		, "Fold Change"
		, "Log Fold Change"
		, "P Value"
		, "Log P Value"
		, "False Discovery Rate"
		, "Log False Discovary Rate"
		, "Intensity"
		, "Log Intensity"
		};
	
	public static String getLabelForType(ValueType type){
		int index = type.ordinal();
		if ((index > 0) && (index < labels.length)) return labels[index];
		else return labels[0];
	}
	
	public static ValueType getTypeForLabel(String label) {
		int probe = 0;
		for (int i = 0; i < labels.length; i++) {
			if (labels[i].equals(label)) {
				probe = i;
			}
		}
		return ValueType.values()[probe];
	}
	
	public static String[] getTypeLabelArray(){
		return labels;
	}

	public static String getDefaultTypeLabel() {
		return getLabelForType(FOLD_CHANGE);
	}
}
